package com.xj.service.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/service")
public class ServiceController {
//    @GetMapping("/get")
//    public String getService(){
//        RestTemplate restTemplate = new RestTemplate();
//        String forObject = restTemplate.getForObject("http://localhost:8009/common", String.class);
//        return "调用成功:"+forObject;
//    }
    @Value("${server.port}")
    private String port;
    @GetMapping("/get")
    public String getService(){
        return port;
    }

}
